#include<iostream>
#include<queue>
#include<string>
using namespace std;
int main()
{
	int n;
	cin >> n;
	queue<char> s;
	queue<int> q;
	string s1;
	cin >> s1;
	int i = 0;

	for(i;i<s1.size();i++)
	{
		s.push(s1[i]);
	}
	int* a = new int[n];
	for (i=0; i < n-1; i++)
	{
		string s2;
		int m = 0;
		while (s.front()!=',')
		{
			s2.push_back(s.front());
			s.pop();
		}
		s.pop();
		a[i] = stoi(s2);
		//cout << a[i] << ' ';
	}
	string s2;
	while (!s.empty())
	{
		 s2.push_back(s.front());
		s.pop();
	}
	a[i] = stoi(s2);
	//cout << a[i];
	int k;
	cin >> k;
	int begin = 0;
	int end = n - 1;
	int mid = (begin + end) / 2;
	while (begin <= end)
	{
		q.push(a[mid]);
		if (a[mid] == k)
			break;
		if (a[mid] > k)
		{
			end = mid-1;
		}
		else
		{
			begin = mid+1;
		}
			mid = (begin + end)/2;
	}
	if (a[mid] == k)
	{
		cout << mid << endl;
	}
	else
	{
		cout << "no" << endl;
	}
	while (!q.empty())
	{
		cout << q.front() ;
		if (q.size() != 1)
		{
			cout << ',';
		}
		q.pop();
	}
}